/*
 * Copyright (c) 2011, Brookhaven National Laboratory
 * All rights reserved.
 * The software in this package is published under the terms
 * of the BSD license a copy of which has been included with
 * this distribution in the license.txt file.
 */

#include <dds/core/Exception.hpp>
#include <dds/xtypes/TypeObject.hpp>

#include <tdds/xtypes/DynamicType.hpp>
#include "dds/type/dynamic/detail/DynamicType.h"

#include "dds/type/dynamic/detail/Descriptor.h"

#include "oxtypes/delegate/DynamicType.h"

#include <tdds/xtypes/DynamicTypeMember.hpp>
#include "dds/type/dynamic/detail/DynamicTypeMember.h"

typedef dds::type::dynamic::detail::DynamicTypeMember DTM;

namespace tdds { namespace type { namespace dynamic {

template <> dds::type::dynamic::MemberDescriptor 
DynamicTypeMember<DTM>::descriptor() const {
  return impl_->md;
}

template <> void 
DynamicTypeMember<DTM>::descriptor(
  const dds::type::dynamic::MemberDescriptor& value){
  impl_->md = value;
}

template <> const dds::type::dynamic::AnnotationDescriptorSeq 
DynamicTypeMember<DTM>::annotation() const {
   throw dds::core::UnsupportedError("");
}
    
template <> dds::type::dynamic::AnnotationDescriptorSeq&
DynamicTypeMember<DTM>::annotation(
  dds::type::dynamic::AnnotationDescriptorSeq& dst) const {
   throw dds::core::UnsupportedError("");
}

template <> void 
DynamicTypeMember<DTM>::apply_annotation(
     const dds::type::dynamic::AnnotationDescriptor& descriptor){
   throw dds::core::UnsupportedError("");
}


template <> DynamicTypeMember<DTM>& 
DynamicTypeMember<DTM>::operator+=(
   const dds::type::dynamic::AnnotationDescriptor& descriptor){
  this->apply_annotation(descriptor);
  return *this;
}

template <> dds::type::MemberId 
DynamicTypeMember<DTM>::id() const {
  return impl_->md.id();
}

template <> const std::string 
DynamicTypeMember<DTM>::name() const {
  return impl_->md.name();
}


template <> bool 
DynamicTypeMember<DTM>::equals(DynamicTypeMember other) {
   throw dds::core::UnsupportedError("");
}

template <> void 
DynamicTypeMember<DTM>::close() {
   throw dds::core::UnsupportedError("");
}

}}}
